﻿using System;
using System.Collections.Generic;
using Assist;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YArchitech.Revit;
using YJKArchUtils.Utils;
using YJKLoopSearch;

namespace YJKRevitRampModule.CreateRampByDoor
{
	public class DoorGeometryExtractor
	{
		public DoorGeometryExtractor(ExternalCommandData cmdData)
		{
			this.m_Revit = cmdData;
			this.m_Doc = this.m_Revit.Application.ActiveUIDocument.Document;
		}

		public void ExtractDoorGeometryInfo(FamilySymbol symbol, ref List<List<EdgeInfo>> doorLoops, ref List<bool> isGlass)
		{
			this.m_FamilySymbol = symbol;
			this.AcitveFamilySymbol();
			List<List<EdgeInfo>> list = new List<List<EdgeInfo>>();
			this.GetLegendEdgeLoopList(ref doorLoops, ref isGlass, ref list);
		}

		public void GetDefaultDoorGeometryInfo(ref List<List<EdgeInfo>> doorLoops, ref List<bool> isGlass)
		{
			List<EdgeInfo> list = new List<EdgeInfo>();
			XYZ startPoint = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item = new EdgeInfo(startPoint, endPoint, 0.0);
			list.Add(item);
			XYZ startPoint2 = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint2 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item2 = new EdgeInfo(startPoint2, endPoint2, 0.0);
			list.Add(item2);
			XYZ startPoint3 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			XYZ endPoint3 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item3 = new EdgeInfo(startPoint3, endPoint3, 0.0);
			list.Add(item3);
			XYZ startPoint4 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			XYZ endPoint4 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item4 = new EdgeInfo(startPoint4, endPoint4, 0.0);
			list.Add(item4);
			XYZ startPoint5 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			XYZ endPoint5 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item5 = new EdgeInfo(startPoint5, endPoint5, 0.0);
			list.Add(item5);
			XYZ startPoint6 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			XYZ endPoint6 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item6 = new EdgeInfo(startPoint6, endPoint6, 0.0);
			list.Add(item6);
			XYZ startPoint7 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			XYZ endPoint7 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item7 = new EdgeInfo(startPoint7, endPoint7, 0.0);
			list.Add(item7);
			XYZ startPoint8 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			XYZ endPoint8 = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item8 = new EdgeInfo(startPoint8, endPoint8, 0.0);
			list.Add(item8);
			doorLoops.Add(list);
			List<EdgeInfo> list2 = new List<EdgeInfo>();
			XYZ startPoint9 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint9 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			EdgeInfo item9 = new EdgeInfo(startPoint9, endPoint9, 0.0);
			list2.Add(item9);
			XYZ startPoint10 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint10 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			EdgeInfo item10 = new EdgeInfo(startPoint10, endPoint10, 0.0);
			list2.Add(item10);
			XYZ startPoint11 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint11 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			EdgeInfo item11 = new EdgeInfo(startPoint11, endPoint11, 0.0);
			list2.Add(item11);
			XYZ startPoint12 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint12 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			EdgeInfo item12 = new EdgeInfo(startPoint12, endPoint12, 0.0);
			list2.Add(item12);
			XYZ startPoint13 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint13 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			EdgeInfo item13 = new EdgeInfo(startPoint13, endPoint13, 0.0);
			list2.Add(item13);
			XYZ startPoint14 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint14 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			EdgeInfo item14 = new EdgeInfo(startPoint14, endPoint14, 0.0);
			list2.Add(item14);
			XYZ startPoint15 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint15 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item15 = new EdgeInfo(startPoint15, endPoint15, 0.0);
			list2.Add(item15);
			XYZ startPoint16 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint16 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item16 = new EdgeInfo(startPoint16, endPoint16, 0.0);
			list2.Add(item16);
			doorLoops.Add(list2);
			List<EdgeInfo> list3 = new List<EdgeInfo>();
			XYZ startPoint17 = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint17 = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item17 = new EdgeInfo(startPoint17, endPoint17, 0.0);
			list3.Add(item17);
			XYZ startPoint18 = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint18 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item18 = new EdgeInfo(startPoint18, endPoint18, 0.0);
			list3.Add(item18);
			XYZ startPoint19 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint19 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item19 = new EdgeInfo(startPoint19, endPoint19, 0.0);
			list3.Add(item19);
			XYZ startPoint20 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint20 = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item20 = new EdgeInfo(startPoint20, endPoint20, 0.0);
			list3.Add(item20);
			doorLoops.Add(list3);
			List<EdgeInfo> list4 = new List<EdgeInfo>();
			XYZ startPoint21 = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint21 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item21 = new EdgeInfo(startPoint21, endPoint21, 0.0);
			list4.Add(item21);
			XYZ startPoint22 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint22 = new XYZ(1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item22 = new EdgeInfo(startPoint22, endPoint22, 0.0);
			list4.Add(item22);
			XYZ startPoint23 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint23 = new XYZ(1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item23 = new EdgeInfo(startPoint23, endPoint23, 0.0);
			list4.Add(item23);
			XYZ startPoint24 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint24 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item24 = new EdgeInfo(startPoint24, endPoint24, 0.0);
			list4.Add(item24);
			doorLoops.Add(list4);
			List<EdgeInfo> list5 = new List<EdgeInfo>();
			XYZ startPoint25 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			XYZ endPoint25 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item25 = new EdgeInfo(startPoint25, endPoint25, 0.0);
			list5.Add(item25);
			XYZ startPoint26 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint26 = new XYZ(1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item26 = new EdgeInfo(startPoint26, endPoint26, 0.0);
			list5.Add(item26);
			XYZ startPoint27 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint27 = new XYZ(1.47965879265092, 0.249999999999994, 0.0);
			EdgeInfo item27 = new EdgeInfo(startPoint27, endPoint27, 0.0);
			list5.Add(item27);
			XYZ startPoint28 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint28 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item28 = new EdgeInfo(startPoint28, endPoint28, 0.0);
			list5.Add(item28);
			doorLoops.Add(list5);
			List<EdgeInfo> list6 = new List<EdgeInfo>();
			XYZ startPoint29 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			XYZ endPoint29 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item29 = new EdgeInfo(startPoint29, endPoint29, 0.0);
			list6.Add(item29);
			XYZ startPoint30 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint30 = new XYZ(1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item30 = new EdgeInfo(startPoint30, endPoint30, 0.0);
			list6.Add(item30);
			XYZ startPoint31 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint31 = new XYZ(1.23031496062992, 0.249999999999994, 0.0);
			EdgeInfo item31 = new EdgeInfo(startPoint31, endPoint31, 0.0);
			list6.Add(item31);
			XYZ startPoint32 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint32 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item32 = new EdgeInfo(startPoint32, endPoint32, 0.0);
			list6.Add(item32);
			doorLoops.Add(list6);
			List<EdgeInfo> list7 = new List<EdgeInfo>();
			XYZ startPoint33 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			XYZ endPoint33 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item33 = new EdgeInfo(startPoint33, endPoint33, 0.0);
			list7.Add(item33);
			XYZ startPoint34 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint34 = new XYZ(1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item34 = new EdgeInfo(startPoint34, endPoint34, 0.0);
			list7.Add(item34);
			XYZ startPoint35 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint35 = new XYZ(1.23031496062992, 0.249999999999994, 6.56167979002625);
			EdgeInfo item35 = new EdgeInfo(startPoint35, endPoint35, 0.0);
			list7.Add(item35);
			XYZ startPoint36 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint36 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item36 = new EdgeInfo(startPoint36, endPoint36, 0.0);
			list7.Add(item36);
			doorLoops.Add(list7);
			List<EdgeInfo> list8 = new List<EdgeInfo>();
			XYZ startPoint37 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			XYZ endPoint37 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item37 = new EdgeInfo(startPoint37, endPoint37, 0.0);
			list8.Add(item37);
			XYZ startPoint38 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			XYZ endPoint38 = new XYZ(-1.23031496062992, 0.332020997375304, 6.56167979002625);
			EdgeInfo item38 = new EdgeInfo(startPoint38, endPoint38, 0.0);
			list8.Add(item38);
			XYZ startPoint39 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint39 = new XYZ(-1.23031496062992, 0.249999999999994, 6.56167979002625);
			EdgeInfo item39 = new EdgeInfo(startPoint39, endPoint39, 0.0);
			list8.Add(item39);
			XYZ startPoint40 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint40 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item40 = new EdgeInfo(startPoint40, endPoint40, 0.0);
			list8.Add(item40);
			doorLoops.Add(list8);
			List<EdgeInfo> list9 = new List<EdgeInfo>();
			XYZ startPoint41 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			XYZ endPoint41 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item41 = new EdgeInfo(startPoint41, endPoint41, 0.0);
			list9.Add(item41);
			XYZ startPoint42 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			XYZ endPoint42 = new XYZ(-1.23031496062992, 0.332020997375304, 0.0);
			EdgeInfo item42 = new EdgeInfo(startPoint42, endPoint42, 0.0);
			list9.Add(item42);
			XYZ startPoint43 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint43 = new XYZ(-1.23031496062992, 0.249999999999994, 0.0);
			EdgeInfo item43 = new EdgeInfo(startPoint43, endPoint43, 0.0);
			list9.Add(item43);
			XYZ startPoint44 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint44 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item44 = new EdgeInfo(startPoint44, endPoint44, 0.0);
			list9.Add(item44);
			doorLoops.Add(list9);
			List<EdgeInfo> list10 = new List<EdgeInfo>();
			XYZ startPoint45 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			XYZ endPoint45 = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			EdgeInfo item45 = new EdgeInfo(startPoint45, endPoint45, 0.0);
			list10.Add(item45);
			XYZ startPoint46 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			XYZ endPoint46 = new XYZ(-1.47965879265092, 0.332020997375304, 0.0);
			EdgeInfo item46 = new EdgeInfo(startPoint46, endPoint46, 0.0);
			list10.Add(item46);
			XYZ startPoint47 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			XYZ endPoint47 = new XYZ(-1.47965879265092, 0.249999999999994, 0.0);
			EdgeInfo item47 = new EdgeInfo(startPoint47, endPoint47, 0.0);
			list10.Add(item47);
			XYZ startPoint48 = new XYZ(-1.47965879265092, 0.332020997375304, 6.81102362204724);
			XYZ endPoint48 = new XYZ(-1.47965879265092, 0.249999999999994, 6.81102362204724);
			EdgeInfo item48 = new EdgeInfo(startPoint48, endPoint48, 0.0);
			list10.Add(item48);
			doorLoops.Add(list10);
			List<EdgeInfo> list11 = new List<EdgeInfo>();
			XYZ startPoint49 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint49 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item49 = new EdgeInfo(startPoint49, endPoint49, 0.0);
			list11.Add(item49);
			XYZ startPoint50 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint50 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item50 = new EdgeInfo(startPoint50, endPoint50, 0.0);
			list11.Add(item50);
			XYZ startPoint51 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			XYZ endPoint51 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			EdgeInfo item51 = new EdgeInfo(startPoint51, endPoint51, 0.0);
			list11.Add(item51);
			XYZ startPoint52 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			XYZ endPoint52 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			EdgeInfo item52 = new EdgeInfo(startPoint52, endPoint52, 0.0);
			list11.Add(item52);
			XYZ startPoint53 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			XYZ endPoint53 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			EdgeInfo item53 = new EdgeInfo(startPoint53, endPoint53, 0.0);
			list11.Add(item53);
			XYZ startPoint54 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			XYZ endPoint54 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			EdgeInfo item54 = new EdgeInfo(startPoint54, endPoint54, 0.0);
			list11.Add(item54);
			XYZ startPoint55 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			XYZ endPoint55 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item55 = new EdgeInfo(startPoint55, endPoint55, 0.0);
			list11.Add(item55);
			XYZ startPoint56 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			XYZ endPoint56 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item56 = new EdgeInfo(startPoint56, endPoint56, 0.0);
			list11.Add(item56);
			doorLoops.Add(list11);
			List<EdgeInfo> list12 = new List<EdgeInfo>();
			XYZ startPoint57 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint57 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			EdgeInfo item57 = new EdgeInfo(startPoint57, endPoint57, 0.0);
			list12.Add(item57);
			XYZ startPoint58 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint58 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			EdgeInfo item58 = new EdgeInfo(startPoint58, endPoint58, 0.0);
			list12.Add(item58);
			XYZ startPoint59 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			XYZ endPoint59 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			EdgeInfo item59 = new EdgeInfo(startPoint59, endPoint59, 0.0);
			list12.Add(item59);
			XYZ startPoint60 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			XYZ endPoint60 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			EdgeInfo item60 = new EdgeInfo(startPoint60, endPoint60, 0.0);
			list12.Add(item60);
			XYZ startPoint61 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			XYZ endPoint61 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			EdgeInfo item61 = new EdgeInfo(startPoint61, endPoint61, 0.0);
			list12.Add(item61);
			XYZ startPoint62 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			XYZ endPoint62 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			EdgeInfo item62 = new EdgeInfo(startPoint62, endPoint62, 0.0);
			list12.Add(item62);
			XYZ startPoint63 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint63 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item63 = new EdgeInfo(startPoint63, endPoint63, 0.0);
			list12.Add(item63);
			XYZ startPoint64 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint64 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item64 = new EdgeInfo(startPoint64, endPoint64, 0.0);
			list12.Add(item64);
			doorLoops.Add(list12);
			List<EdgeInfo> list13 = new List<EdgeInfo>();
			XYZ startPoint65 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint65 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item65 = new EdgeInfo(startPoint65, endPoint65, 0.0);
			list13.Add(item65);
			XYZ startPoint66 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint66 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item66 = new EdgeInfo(startPoint66, endPoint66, 0.0);
			list13.Add(item66);
			XYZ startPoint67 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint67 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item67 = new EdgeInfo(startPoint67, endPoint67, 0.0);
			list13.Add(item67);
			XYZ startPoint68 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint68 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item68 = new EdgeInfo(startPoint68, endPoint68, 0.0);
			list13.Add(item68);
			doorLoops.Add(list13);
			List<EdgeInfo> list14 = new List<EdgeInfo>();
			XYZ startPoint69 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint69 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item69 = new EdgeInfo(startPoint69, endPoint69, 0.0);
			list14.Add(item69);
			XYZ startPoint70 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint70 = new XYZ(-1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item70 = new EdgeInfo(startPoint70, endPoint70, 0.0);
			list14.Add(item70);
			XYZ startPoint71 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint71 = new XYZ(-1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item71 = new EdgeInfo(startPoint71, endPoint71, 0.0);
			list14.Add(item71);
			XYZ startPoint72 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint72 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item72 = new EdgeInfo(startPoint72, endPoint72, 0.0);
			list14.Add(item72);
			doorLoops.Add(list14);
			List<EdgeInfo> list15 = new List<EdgeInfo>();
			XYZ startPoint73 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			XYZ endPoint73 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			EdgeInfo item73 = new EdgeInfo(startPoint73, endPoint73, 0.0);
			list15.Add(item73);
			XYZ startPoint74 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint74 = new XYZ(-1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item74 = new EdgeInfo(startPoint74, endPoint74, 0.0);
			list15.Add(item74);
			XYZ startPoint75 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			XYZ endPoint75 = new XYZ(-1.47965879265092, -0.250000000000012, 0.0);
			EdgeInfo item75 = new EdgeInfo(startPoint75, endPoint75, 0.0);
			list15.Add(item75);
			XYZ startPoint76 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			XYZ endPoint76 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			EdgeInfo item76 = new EdgeInfo(startPoint76, endPoint76, 0.0);
			list15.Add(item76);
			doorLoops.Add(list15);
			List<EdgeInfo> list16 = new List<EdgeInfo>();
			XYZ startPoint77 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			XYZ endPoint77 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			EdgeInfo item77 = new EdgeInfo(startPoint77, endPoint77, 0.0);
			list16.Add(item77);
			XYZ startPoint78 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			XYZ endPoint78 = new XYZ(-1.23031496062992, -0.332020997375358, 0.0);
			EdgeInfo item78 = new EdgeInfo(startPoint78, endPoint78, 0.0);
			list16.Add(item78);
			XYZ startPoint79 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			XYZ endPoint79 = new XYZ(-1.23031496062992, -0.250000000000012, 0.0);
			EdgeInfo item79 = new EdgeInfo(startPoint79, endPoint79, 0.0);
			list16.Add(item79);
			XYZ startPoint80 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			XYZ endPoint80 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			EdgeInfo item80 = new EdgeInfo(startPoint80, endPoint80, 0.0);
			list16.Add(item80);
			doorLoops.Add(list16);
			List<EdgeInfo> list17 = new List<EdgeInfo>();
			XYZ startPoint81 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			XYZ endPoint81 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			EdgeInfo item81 = new EdgeInfo(startPoint81, endPoint81, 0.0);
			list17.Add(item81);
			XYZ startPoint82 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			XYZ endPoint82 = new XYZ(-1.23031496062992, -0.332020997375358, 6.56167979002624);
			EdgeInfo item82 = new EdgeInfo(startPoint82, endPoint82, 0.0);
			list17.Add(item82);
			XYZ startPoint83 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			XYZ endPoint83 = new XYZ(-1.23031496062992, -0.250000000000012, 6.56167979002624);
			EdgeInfo item83 = new EdgeInfo(startPoint83, endPoint83, 0.0);
			list17.Add(item83);
			XYZ startPoint84 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			XYZ endPoint84 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			EdgeInfo item84 = new EdgeInfo(startPoint84, endPoint84, 0.0);
			list17.Add(item84);
			doorLoops.Add(list17);
			List<EdgeInfo> list18 = new List<EdgeInfo>();
			XYZ startPoint85 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			XYZ endPoint85 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			EdgeInfo item85 = new EdgeInfo(startPoint85, endPoint85, 0.0);
			list18.Add(item85);
			XYZ startPoint86 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			XYZ endPoint86 = new XYZ(1.23031496062995, -0.332020997375358, 6.56167979002624);
			EdgeInfo item86 = new EdgeInfo(startPoint86, endPoint86, 0.0);
			list18.Add(item86);
			XYZ startPoint87 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			XYZ endPoint87 = new XYZ(1.23031496062995, -0.250000000000012, 6.56167979002624);
			EdgeInfo item87 = new EdgeInfo(startPoint87, endPoint87, 0.0);
			list18.Add(item87);
			XYZ startPoint88 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			XYZ endPoint88 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			EdgeInfo item88 = new EdgeInfo(startPoint88, endPoint88, 0.0);
			list18.Add(item88);
			doorLoops.Add(list18);
			List<EdgeInfo> list19 = new List<EdgeInfo>();
			XYZ startPoint89 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			XYZ endPoint89 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item89 = new EdgeInfo(startPoint89, endPoint89, 0.0);
			list19.Add(item89);
			XYZ startPoint90 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			XYZ endPoint90 = new XYZ(1.23031496062995, -0.332020997375358, 0.0);
			EdgeInfo item90 = new EdgeInfo(startPoint90, endPoint90, 0.0);
			list19.Add(item90);
			XYZ startPoint91 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint91 = new XYZ(1.23031496062995, -0.250000000000012, 0.0);
			EdgeInfo item91 = new EdgeInfo(startPoint91, endPoint91, 0.0);
			list19.Add(item91);
			XYZ startPoint92 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint92 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item92 = new EdgeInfo(startPoint92, endPoint92, 0.0);
			list19.Add(item92);
			doorLoops.Add(list19);
			List<EdgeInfo> list20 = new List<EdgeInfo>();
			XYZ startPoint93 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			XYZ endPoint93 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			EdgeInfo item93 = new EdgeInfo(startPoint93, endPoint93, 0.0);
			list20.Add(item93);
			XYZ startPoint94 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			XYZ endPoint94 = new XYZ(1.47965879265092, -0.332020997375358, 0.0);
			EdgeInfo item94 = new EdgeInfo(startPoint94, endPoint94, 0.0);
			list20.Add(item94);
			XYZ startPoint95 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			XYZ endPoint95 = new XYZ(1.47965879265092, -0.250000000000012, 0.0);
			EdgeInfo item95 = new EdgeInfo(startPoint95, endPoint95, 0.0);
			list20.Add(item95);
			XYZ startPoint96 = new XYZ(1.47965879265092, -0.332020997375358, 6.81102362204724);
			XYZ endPoint96 = new XYZ(1.47965879265092, -0.250000000000012, 6.81102362204724);
			EdgeInfo item96 = new EdgeInfo(startPoint96, endPoint96, 0.0);
			list20.Add(item96);
			doorLoops.Add(list20);
			List<EdgeInfo> list21 = new List<EdgeInfo>();
			XYZ startPoint97 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint97 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item97 = new EdgeInfo(startPoint97, endPoint97, 0.0);
			list21.Add(item97);
			XYZ startPoint98 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint98 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item98 = new EdgeInfo(startPoint98, endPoint98, 0.0);
			list21.Add(item98);
			XYZ startPoint99 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			XYZ endPoint99 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item99 = new EdgeInfo(startPoint99, endPoint99, 0.0);
			list21.Add(item99);
			XYZ startPoint100 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			XYZ endPoint100 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item100 = new EdgeInfo(startPoint100, endPoint100, 0.0);
			list21.Add(item100);
			doorLoops.Add(list21);
			List<EdgeInfo> list22 = new List<EdgeInfo>();
			XYZ startPoint101 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint101 = new XYZ(1.23031496062992, 0.25, 0.0);
			EdgeInfo item101 = new EdgeInfo(startPoint101, endPoint101, 0.0);
			list22.Add(item101);
			XYZ startPoint102 = new XYZ(1.23031496062992, 0.25, 0.0);
			XYZ endPoint102 = new XYZ(-1.23031496062992, 0.25, 0.0);
			EdgeInfo item102 = new EdgeInfo(startPoint102, endPoint102, 0.0);
			list22.Add(item102);
			XYZ startPoint103 = new XYZ(-1.23031496062992, 0.25, 0.0);
			XYZ endPoint103 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item103 = new EdgeInfo(startPoint103, endPoint103, 0.0);
			list22.Add(item103);
			XYZ startPoint104 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint104 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item104 = new EdgeInfo(startPoint104, endPoint104, 0.0);
			list22.Add(item104);
			doorLoops.Add(list22);
			List<EdgeInfo> list23 = new List<EdgeInfo>();
			XYZ startPoint105 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint105 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item105 = new EdgeInfo(startPoint105, endPoint105, 0.0);
			list23.Add(item105);
			XYZ startPoint106 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint106 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item106 = new EdgeInfo(startPoint106, endPoint106, 0.0);
			list23.Add(item106);
			XYZ startPoint107 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint107 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item107 = new EdgeInfo(startPoint107, endPoint107, 0.0);
			list23.Add(item107);
			XYZ startPoint108 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint108 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item108 = new EdgeInfo(startPoint108, endPoint108, 0.0);
			list23.Add(item108);
			doorLoops.Add(list23);
			List<EdgeInfo> list24 = new List<EdgeInfo>();
			XYZ startPoint109 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint109 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item109 = new EdgeInfo(startPoint109, endPoint109, 0.0);
			list24.Add(item109);
			XYZ startPoint110 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint110 = new XYZ(-1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item110 = new EdgeInfo(startPoint110, endPoint110, 0.0);
			list24.Add(item110);
			XYZ startPoint111 = new XYZ(-1.23031496062992, 0.25, 0.0);
			XYZ endPoint111 = new XYZ(-1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item111 = new EdgeInfo(startPoint111, endPoint111, 0.0);
			list24.Add(item111);
			XYZ startPoint112 = new XYZ(-1.23031496062992, 0.25, 0.0);
			XYZ endPoint112 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item112 = new EdgeInfo(startPoint112, endPoint112, 0.0);
			list24.Add(item112);
			doorLoops.Add(list24);
			List<EdgeInfo> list25 = new List<EdgeInfo>();
			XYZ startPoint113 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			XYZ endPoint113 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item113 = new EdgeInfo(startPoint113, endPoint113, 0.0);
			list25.Add(item113);
			XYZ startPoint114 = new XYZ(-1.23031496062992, 0.25, 0.0);
			XYZ endPoint114 = new XYZ(-1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item114 = new EdgeInfo(startPoint114, endPoint114, 0.0);
			list25.Add(item114);
			XYZ startPoint115 = new XYZ(1.23031496062992, 0.25, 0.0);
			XYZ endPoint115 = new XYZ(-1.23031496062992, 0.25, 0.0);
			EdgeInfo item115 = new EdgeInfo(startPoint115, endPoint115, 0.0);
			list25.Add(item115);
			XYZ startPoint116 = new XYZ(1.23031496062992, 0.25, 0.0);
			XYZ endPoint116 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item116 = new EdgeInfo(startPoint116, endPoint116, 0.0);
			list25.Add(item116);
			doorLoops.Add(list25);
			List<EdgeInfo> list26 = new List<EdgeInfo>();
			XYZ startPoint117 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			XYZ endPoint117 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			EdgeInfo item117 = new EdgeInfo(startPoint117, endPoint117, 0.0);
			list26.Add(item117);
			XYZ startPoint118 = new XYZ(1.23031496062992, 0.25, 0.0);
			XYZ endPoint118 = new XYZ(1.23031496062992, 0.0826771653543125, 0.0);
			EdgeInfo item118 = new EdgeInfo(startPoint118, endPoint118, 0.0);
			list26.Add(item118);
			XYZ startPoint119 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			XYZ endPoint119 = new XYZ(1.23031496062992, 0.25, 0.0);
			EdgeInfo item119 = new EdgeInfo(startPoint119, endPoint119, 0.0);
			list26.Add(item119);
			XYZ startPoint120 = new XYZ(1.23031496062992, 0.0826771653543125, 6.56167979002624);
			XYZ endPoint120 = new XYZ(1.23031496062992, 0.25, 6.56167979002624);
			EdgeInfo item120 = new EdgeInfo(startPoint120, endPoint120, 0.0);
			list26.Add(item120);
			doorLoops.Add(list26);
			foreach (List<EdgeInfo> list27 in doorLoops)
			{
				isGlass.Add(false);
			}
		}

		private string XYZToCode(XYZ pt, string ptName)
		{
			string text = "XYZ " + ptName + " = new XYZ(";
			return string.Concat(new string[]
			{
				text,
				pt.X.ToString(),
				", ",
				pt.Y.ToString(),
				", ",
				pt.Z.ToString(),
				");/r/n"
			});
		}

		private void AcitveFamilySymbol()
		{
			Transaction transaction = new Transaction(this.m_Revit.Application.ActiveUIDocument.Document);
			transaction.Start("acitve family symbol");
			try
			{
				RevitVersionFuncs.FamilySymbolActivate(this.m_FamilySymbol);
			}
			catch (Exception)
			{
				transaction.RollBack();
			}
			transaction.Commit();
		}

		private void GetLegendEdgeLoopList(ref List<List<EdgeInfo>> faceEdgeLoopList, ref List<bool> isGlass, ref List<List<EdgeInfo>> profileEdgeLoopList)
		{
			List<bool> list = new List<bool>();
			List<Face> faceWithFamilyInstance = this.GetFaceWithFamilyInstance(ref list);
			List<PlanarFace> list2 = new List<PlanarFace>();
			int i = 0;
			foreach (Face face in faceWithFamilyInstance)
			{
				new List<List<EdgeInfo>>();
				foreach (List<EdgeInfo> item in this.GetEdgeLoopListWithFace(face))
				{
					faceEdgeLoopList.Add(item);
					isGlass.Add(list[i]);
				}
				if (face.GetType() == typeof(PlanarFace))
				{
					PlanarFace planarFace = face as PlanarFace;
					if (planarFace.FaceNormal().IsAlmostEqualTo(XYZ.BasisY) || planarFace.FaceNormal().IsAlmostEqualTo(-XYZ.BasisY))
					{
						list2.Add(planarFace);
					}
				}
				i++;
			}
			if (list2.Count == 0)
			{
				return;
			}
			list2.Sort((PlanarFace left, PlanarFace right) => left.Area.CompareTo(right.Area));
			List<PlanarFace> list3 = new List<PlanarFace>();
			if (list2.Count > 20)
			{
				for (i = 0; i < (int)((double)list2.Count / 5.0); i++)
				{
					list3.Add(list2[i]);
				}
			}
			else
			{
				list3.AddRange(list2);
			}
			foreach (Face face2 in list2)
			{
				new List<List<EdgeInfo>>();
				foreach (List<EdgeInfo> item2 in this.GetEdgeLoopListWithFace(face2))
				{
					profileEdgeLoopList.Add(item2);
				}
			}
		}

		private void GetProfileLoop(List<List<EdgeInfo>> doorLoops, ref List<XYZ> profileLoop)
		{
			Transform transform = RevitVersionFuncs.CreateRotationAtPoint(XYZ.BasisX, -Math.PI*.5, XYZ.Zero);
			Transform inverse = transform.Inverse;
			List<Pole2D> list = new List<Pole2D>();
			foreach (List<EdgeInfo> list2 in doorLoops)
			{
				foreach (EdgeInfo edgeInfo in list2)
				{
					XYZ xyz = this.FormatPt(this.To2D(Geometry.TransformPoint(edgeInfo.StartPoint, transform)));
					XYZ xyz2 = this.FormatPt(this.To2D(Geometry.TransformPoint(edgeInfo.EndPoint, transform)));
					if (!xyz.IsAlmostEqualTo(xyz2))
					{
						Pole2D item = Pole2D.NewStructure2DPole(ElementId.InvalidElementId, xyz, xyz2, 0.0, 0.0);
						list.Add(item);
					}
				}
			}
			List<List<Curve>> fullFloorEdgeLoops = new StructureLoopSearcher(this.m_Revit).GetFullFloorEdgeLoops(list, StructureLoopSearcher.SearchEdgeLocation.SEL_Outside);
			if (fullFloorEdgeLoops.Count == 0)
			{
				return;
			}
			foreach (Curve curve in fullFloorEdgeLoops[0])
			{
				XYZ xyz3 = Geometry.TransformPoint(curve.GetEndPoint(0), inverse);
				xyz3 = new XYZ(Common.FeetToMM(xyz3.X), Common.FeetToMM(xyz3.Y), Common.FeetToMM(xyz3.Z));
				profileLoop.Add(xyz3);
			}
		}

		private XYZ FormatPt(XYZ pt)
		{
			double num = Convert.ToDouble(pt.X.ToString("f3"));
			double num2 = Convert.ToDouble(pt.Y.ToString("f3"));
			double num3 = Convert.ToDouble(pt.Z.ToString("f3"));
			return new XYZ(num, num2, num3);
		}

		private XYZ To2D(XYZ pt)
		{
			return new XYZ(pt.X, pt.Y, 0.0);
		}

		private List<Face> GetFaceWithFamilyInstance(ref List<bool> isGlassWithFace)
		{
			List<Face> list = new List<Face>();
			Options options = new Options();
			options.ComputeReferences = true;
			options.DetailLevel = (ViewDetailLevel)2;
			GeometryElement geometryElement = this.m_FamilySymbol.get_Geometry(options);
			if (geometryElement == null)
			{
				return list;
			}
			foreach (GeometryObject geometryObject in geometryElement)
			{
				Solid solid = geometryObject as Solid;
				if (!(solid == null))
				{
					GraphicsStyle graphicsStyle = this.m_Doc.GetElement(solid.GraphicsStyleId) as GraphicsStyle;
					if (graphicsStyle != null && graphicsStyle.GraphicsStyleCategory.Name.CompareTo("玻璃") != 0)
					{
						foreach (object obj in solid.Faces)
						{
							Face item = (Face)obj;
							list.Add(item);
							isGlassWithFace.Add(false);
						}
					}
				}
			}
			return list;
		}

		private List<List<EdgeInfo>> GetLoopsByMesh(Mesh mesh)
		{
			List<List<EdgeInfo>> list = new List<List<EdgeInfo>>();
			int numTriangles = mesh.NumTriangles;
			for (int i = 0; i < numTriangles; i++)
			{
				MeshTriangle meshTriangle = mesh.get_Triangle(i);
				List<EdgeInfo> list2 = new List<EdgeInfo>();
				XYZ xyz = meshTriangle.get_Vertex(0);
				XYZ xyz2 = meshTriangle.get_Vertex(1);
				XYZ xyz3 = meshTriangle.get_Vertex(2);
				EdgeInfo item = new EdgeInfo(xyz, xyz2, 0.0);
				list2.Add(item);
				EdgeInfo item2 = new EdgeInfo(xyz2, xyz3, 0.0);
				list2.Add(item2);
				EdgeInfo item3 = new EdgeInfo(xyz3, xyz, 0.0);
				list2.Add(item3);
				list.Add(list2);
			}
			return list;
		}

		private List<List<EdgeInfo>> GetEdgeLoopListWithFace(Face face)
		{
			List<List<EdgeInfo>> list = new List<List<EdgeInfo>>();
			if (face.EdgeLoops.Size > 1 || face.GetType() != typeof(PlanarFace))
			{
				Mesh mesh = face.Triangulate();
				list.AddRange(this.GetLoopsByMesh(mesh));
				return list;
			}
			foreach (object obj in face.EdgeLoops)
			{
				EdgeArray edgeArray = (EdgeArray)obj;
				List<EdgeInfo> list2 = new List<EdgeInfo>();
				foreach (object obj2 in edgeArray)
				{
					Curve curve = ((Edge)obj2).AsCurve();
					if (curve.GetType() == typeof(Line))
					{
						EdgeInfo item = new EdgeInfo(curve.GetEndPoint(0), curve.GetEndPoint(1), 0.0);
						list2.Add(item);
					}
					else
					{
						IList<XYZ> list3 = curve.Tessellate();
						for (int i = 0; i < list3.Count - 1; i++)
						{
							EdgeInfo item2 = new EdgeInfo(list3[i], list3[i + 1], 0.0);
							list2.Add(item2);
						}
					}
				}
				list.Add(list2);
			}
			return list;
		}

		private ExternalCommandData m_Revit;

		private Document m_Doc;

		private FamilySymbol m_FamilySymbol;
	}
}
